home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 3 code / Video Accelerator / GC FKEY / GCFkey.c next >
Encoding:
C/C++ Source or Header  |  1990-06-08  |  1.1 KB  |  54 lines  |  [TEXT/MPS ]

  1. /***********************************************************************************************
  2.  
  3.  
  4.     File:            GraphAccelFKey.c
  5.     Date:            Wednesday, February 22, 1989 2:48:09 PM
  6.  
  7.     ________________________
  8.     
  9.     
  10.     Copyright Apple Computer, Inc. 1988-1989. All Rights Reserved.
  11.     Reproduction or distribution in any form without written permission is 
  12.     prohibitted.
  13.  
  14.     
  15.     Sample 'FKEY' resource demonstarting how to turn acceleration on and off.
  16.     After compiling this code it is necessary to link with GraphAccel.o.
  17.     
  18. ************************************************************************************************/
  19.  
  20.  
  21. #include    <OSUtils.h>
  22. #include    "GraphAccel.h"
  23.  
  24.  
  25.  
  26. pascal void 
  27. GCFkey()
  28.  
  29. {    
  30.  
  31.     int    res;
  32.     
  33.     
  34.     
  35.     if ( (res=GCStatus()) == 1 ) {         /* acceleration is on     */
  36.         if ( GCAcceleration(0) < 0 )    /* let turn it off        */
  37.             Error(res);
  38.     } else if ( res == 0 ) {            /* when it is off        */
  39.         if ( GCAcceleration(1) < 0 )    /* turn it on            */
  40.             Error(res);
  41.     } else 
  42.         Error(res);
  43. }
  44.  
  45.  
  46.  
  47. Error(int num)
  48. {
  49.     if ( num )
  50.         ;                        /* some error ...             */
  51.     SysBeep(1);                    /* make some sound and exit */
  52. }
  53.  
  54.